using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class CustomerProductMap : EntityTypeConfiguration<CustomerProduct>
    {
        public CustomerProductMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ProductByName)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("CustomerProduct");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.CustomerID).HasColumnName("CustomerID");
            this.Property(t => t.ProductID).HasColumnName("ProductID");
            this.Property(t => t.ProductByName).HasColumnName("ProductByName");
            this.Property(t => t.Price).HasColumnName("Price");
        }
    }
}
